home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / Chip_2004-07_cd1.bin / oddech / pipe / PipeDownDemo.exe / 2057 / SHOCKWAVE / 132 / 00004_Movie Script.ls < prev    next >
Encoding:
Text File  |  2004-05-25  |  8.0 KB  |  320 lines

  1. global gKeyOn, gGameMode, gLoaded, gLevel, gLevelMax, gScore, gSkillMode, gLevelFour, gGameList, gGameName, gGameID, gMenuCalled, gGameType, gClickedArrow, _DEBUG, gBuyURL, gBuyURLNum, gBuyURLaid, gMoreURL
  2.  
  3. on prepareMovie
  4.   gLoaded = 0
  5.   set the keyDownScript to "keyDownCheck"
  6.   gKeyOn = #none
  7.   gClickedArrow = 0
  8.   gBuyURL = []
  9.   gBuyURL.add("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=nik@catalystpics.co.uk¤cy=USD&item_name=PipeDown&item_number=Catalyst&amount=9.95")
  10.   gBuyURL.add("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=nik@catalystpics.co.uk¤cy=USD&item_name=PipeDown&item_number=TinyArcade&amount=9.95")
  11.   gBuyURL.add("http://www.miniclip.com/buy_pipedown.htm")
  12.   gBuyURL.add("http://www.arcadetown.com/order/choosemethod.asp?gameid=pipedown")
  13.   gMoreURL = []
  14.   gMoreURL.add("http://www.catalystpics.co.uk/games.html")
  15.   gMoreURL.add("http://www.catalystpics.co.uk/games.html")
  16.   gMoreURL.add("http://www.miniclip.com")
  17.   gMoreURL.add("http://www.arcadetown.com/index.asp?gameid=pipedown&aid=")
  18.   _DEBUG = 0
  19. end
  20.  
  21. on startMovie
  22.   if _DEBUG then
  23.     screenSize = 1
  24.     gGameType = "demo"
  25.     gBuyURLNum = 1
  26.   else
  27.     gGameType = "none"
  28.     checkCount = 900000
  29.     repeat while (gGameType = "none") and (checkCount > 0)
  30.       paramCount = externalParamCount()
  31.       if paramCount > 1 then
  32.         repeat with n = 1 to paramCount
  33.           tName = externalParamName(n)
  34.           if tName = "sw3" then
  35.             gGameType = externalParamValue(n)
  36.           end if
  37.         end repeat
  38.       end if
  39.       checkCount = checkCount - 1
  40.     end repeat
  41.     if checkCount <= 0 then
  42.       gGameType = "web"
  43.     end if
  44.     if gGameType = "4ul5er510n" then
  45.       gGameType = "full"
  46.     end if
  47.     if gGameType = "web" then
  48.       screenSize = 1
  49.     else
  50.       screenSize = "none"
  51.       checkCount = 900000
  52.       repeat while (screenSize = "none") and (checkCount > 0)
  53.         paramCount = externalParamCount()
  54.         if paramCount > 1 then
  55.           repeat with n = 1 to paramCount
  56.             tName = externalParamName(n)
  57.             if tName = "sw4" then
  58.               screenSize = externalParamValue(n)
  59.             end if
  60.           end repeat
  61.         end if
  62.         checkCount = checkCount - 1
  63.       end repeat
  64.       if checkCount <= 0 then
  65.         screenSize = 1
  66.       end if
  67.     end if
  68.     if gGameType <> "full" then
  69.       gBuyURLNum = "none"
  70.       checkCount = 900000
  71.       repeat while (gBuyURLNum = "none") and (checkCount > 0)
  72.         paramCount = externalParamCount()
  73.         if paramCount > 1 then
  74.           repeat with n = 1 to paramCount
  75.             tName = externalParamName(n)
  76.             if tName = "sw2" then
  77.               gBuyURLNum = externalParamValue(n)
  78.             end if
  79.           end repeat
  80.         end if
  81.         checkCount = checkCount - 1
  82.       end repeat
  83.       if checkCount <= 0 then
  84.         gBuyURLNum = 1
  85.       end if
  86.     end if
  87.     gBuyURLNum = value(gBuyURLNum)
  88.     if (gBuyURLNum = 4) and (gGameType = "web") then
  89.       gBuyURLaid = "none"
  90.       checkCount = 100000
  91.       repeat while (gBuyURLaid = "none") and (checkCount > 0)
  92.         paramCount = externalParamCount()
  93.         if paramCount > 1 then
  94.           repeat with n = 1 to paramCount
  95.             tName = externalParamName(n)
  96.             if tName = "sw5" then
  97.               gBuyURLaid = externalParamValue(n)
  98.             end if
  99.           end repeat
  100.         end if
  101.         checkCount = checkCount - 1
  102.       end repeat
  103.       if gBuyURLaid <> "none" then
  104.         gBuyURL[4] = gBuyURL[4] & "&aid=" & gBuyURLaid
  105.         gMoreURL[4] = gMoreURL[4] & gBuyURLaid
  106.       end if
  107.     end if
  108.   end if
  109.   setVariable(sprite(1), "gameType", gGameType)
  110.   setVariable(sprite(1), "screenSize", string(screenSize))
  111.   if gGameType <> "full" then
  112.     gLevelMax = 6
  113.   else
  114.     gLevelMax = 50
  115.   end if
  116.   put gGameType, screenSize, gBuyURLNum
  117. end
  118.  
  119. on newGame
  120.   gSkillMode = value(getVariable(sprite(1), "skillMode"))
  121.   gLevel = value(getVariable(sprite(1), "level"))
  122.   if gLevel = 0 then
  123.     gLevel = 1
  124.   end if
  125.   if _DEBUG then
  126.     gLevel = 1
  127.   end if
  128.   gScore = 0
  129.   gMenuCalled = 0
  130.   go("newlevel")
  131. end
  132.  
  133. on newLevel
  134.   go("newlevel")
  135. end
  136.  
  137. on gotoMenu
  138.   gMenuCalled = 1
  139.   gGameMode = #finish
  140. end
  141.  
  142. on getSaved
  143.   modeList = ["speed", "puzzle", "genius"]
  144.   gGameList = []
  145.   gameList = "none"
  146.   if _DEBUG then
  147.     gameList = "Paul_Barnes #?!!# Speed_play_game_1 Caroline PJP 1 2 3 1 2"
  148.   end if
  149.   externalEvent("getSaved")
  150.   repeat while gameList = "none"
  151.     paramCount = externalParamCount()
  152.     if paramCount > 1 then
  153.       repeat with n = 1 to paramCount
  154.         tName = externalParamName(n)
  155.         if tName = "sw7" then
  156.           gameList = externalParamValue(n)
  157.         end if
  158.       end repeat
  159.     end if
  160.   end repeat
  161.   gameCount = integer(the number of words in gameList * 0.5)
  162.   put "count = " & gameCount
  163.   repeat with i = 1 to gameCount * 2
  164.     if i <= gameCount then
  165.       n = gameList.word[i]
  166.       gname = EMPTY
  167.       repeat with j = 1 to n.length
  168.         if n.char[j] = "_" then
  169.           gname = gname & " "
  170.           next repeat
  171.         end if
  172.         gname = gname & n.char[j]
  173.       end repeat
  174.       if gname = "#?!!#" then
  175.         gGameList[i] = "<empty>"
  176.       else
  177.         gGameList[i] = gname
  178.       end if
  179.       setVariable(sprite(1), "gameName" & i, gGameList[i])
  180.       next repeat
  181.     end if
  182.     mn = value(gameList.word[i])
  183.     if mn > 0 then
  184.       setVariable(sprite(1), "gameMode" & i - gameCount, modeList[mn])
  185.       next repeat
  186.     end if
  187.     setVariable(sprite(1), "gameMode" & i - gameCount, EMPTY)
  188.   end repeat
  189. end
  190.  
  191. on saveGame
  192.   id = getVariable(sprite(1), "gameID")
  193.   gnameF = getVariable(sprite(1), "gameName")
  194.   wc = the number of words in gnameF
  195.   if wc > 1 then
  196.     gname = EMPTY
  197.     repeat with i = 1 to wc
  198.       gname = gname & gnameF.word[i]
  199.       if i < wc then
  200.         gname = gname & "_"
  201.       end if
  202.     end repeat
  203.   else
  204.     gname = gnameF
  205.   end if
  206.   txt = "saveGame(" & id & "," & gname & "," & gScore & "," & gLevel & "," & gSkillMode & ")"
  207.   externalEvent(txt)
  208.   setVariable(sprite(1), "saveInfo", "game saved successfully")
  209. end
  210.  
  211. on loadGame
  212.   id = getVariable(sprite(1), "gameID")
  213.   gGameID = value(id)
  214.   externalEvent("setGame(" & id & ")")
  215.   gLevel = 0
  216.   repeat while gLevel = 0
  217.     paramCount = externalParamCount()
  218.     if paramCount > 1 then
  219.       repeat with n = 1 to paramCount
  220.         tName = externalParamName(n)
  221.         if tName = "sw6" then
  222.           gSkillMode = externalParamValue(n)
  223.         end if
  224.         if tName = "sw8" then
  225.           gScore = externalParamValue(n)
  226.         end if
  227.         if tName = "sw9" then
  228.           gLevel = externalParamValue(n)
  229.         end if
  230.       end repeat
  231.     end if
  232.   end repeat
  233.   gLevel = value(gLevel)
  234.   gScore = value(gScore)
  235.   gSkillMode = value(gSkillMode)
  236.   go("newlevel")
  237. end
  238.  
  239. on soundFX fxMember, fxChannel, fxVol
  240.   sound(fxChannel).volume = fxVol
  241.   sound(fxChannel).play(member(fxMember))
  242. end
  243.  
  244. on drop
  245.   if gGameMode <> #drop then
  246.     gGameMode = #dropbutton
  247.   end if
  248. end
  249.  
  250. on moveFlash flabel
  251.   setVariable(sprite(1), "frameLabel", string(flabel))
  252.   sprite(1).tellTarget("frameSkip")
  253.   sprite(1).frame = 2
  254.   sprite(1).endTellTarget()
  255. end
  256.  
  257. on flashSFX
  258.   sprite(1).tellTarget("sfx")
  259.   sprite(1).frame = 2
  260.   sprite(1).endTellTarget()
  261. end
  262.  
  263. on GetUrl
  264.   nURL = getVariable(sprite(1), "url")
  265.   if nURL = "buy" then
  266.     nURL = gBuyURL[gBuyURLNum]
  267.   else
  268.     if nURL = "moregames" then
  269.       nURL = gMoreURL[gBuyURLNum]
  270.     end if
  271.   end if
  272.   if gGameType = "web" then
  273.     gotoNetPage(nURL, "_blank")
  274.   else
  275.     externalEvent("getURL(" & nURL & ")")
  276.   end if
  277. end
  278.  
  279. on quitGame
  280.   externalEvent("quit")
  281. end
  282.  
  283. on startIns
  284.   go("ins")
  285. end
  286.  
  287. on cursor28
  288.   gGameMode = #cursor28
  289. end
  290.  
  291. on fullScreenRes
  292.   gSize = getVariable(sprite(1), "screenSize")
  293.   sz = "fullScreenRes(" & gSize & ")"
  294.   externalEvent(sz)
  295. end
  296.  
  297. on sizeWindow
  298.   gSize = value(getVariable(sprite(1), "screenSize"))
  299.   if gSize > 0 then
  300.     externalEvent("resize")
  301.   end if
  302. end
  303.  
  304. on hint
  305.   hintState = getVariable(sprite(1), "hintState")
  306.   if hintState = "ON" then
  307.     gGameMode = #hint
  308.   else
  309.     gGameMode = #hintend
  310.   end if
  311. end
  312.  
  313. on reset
  314.   gGameMode = #reset
  315. end
  316.  
  317. on keyDownCheck
  318.   put the keyCode
  319. end
  320.